package com.study.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.servlet.ModelAndView;

import com.alibaba.fastjson.JSONObject;
import com.study.services.FillSevice;

@Controller
public class FillController {
  @Autowired
  FillSevice fs;
  
  
  @GetMapping("Fill")
	public ModelAndView fill(HttpServletRequest request) {
	  
		String useid =request.getSession().getAttribute("useid").toString();
		// @GetMapping没有带斜杠/，默认的视图是jsp/add.jsp页面
		ModelAndView mv = new ModelAndView("beforeSale/fill");
		JSONObject selectFill = fs.selectFill(useid);

		System.out.println("来了老弟fill");
		mv.addObject("fill",selectFill);
		return mv; 
	}
}
